# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>

pkgname=libcloudproviders
pkgver=0.2.5+9+g93dc5ea
pkgrel=1
pkgdesc="DBus API that allows cloud storage sync clients to expose their services"
url="https://gitlab.gnome.org/Incubator/libcloudproviders"
arch=(x86_64)
license=(LGPL3)
depends=(glib2)
makedepends=(git meson gtk-doc)
_commit=93dc5ea32d2ae8128cbf88cc336ab5278ddd696e  # master
source=("git+https://gitlab.gnome.org/Incubator/libcloudproviders.git#commit=$_commit"
        0001-collector-Always-return-a-new-reference-to-the-singl.patch)
sha256sums=('SKIP'
            '64bfe860ece46392258accd56f00f9f0001dec700613d9e484b3459da91a1c13')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname
  patch -Np1 -i ../0001-collector-Always-return-a-new-reference-to-the-singl.patch
}

build() {
  arch-meson $pkgname build -Denable-gtk-doc=true
  ninja -C build
}

check() {
  cd build
  meson test
}

package() {
  DESTDIR="$pkgdir" ninja -C build install
}
